<?php
namespace app\home\validate;
use think\Validate;

class Friend extends Validate
{
    protected $rule = [
    'contact_name'  => 'require|min:2|max:20',
    'contact_email' => 'require|email',
    'contact_title'   => 'require|max:8',
    'contact_message' => 'require'
    ];

    protected $message = [
    'contact_message.require'   => '联系姓名必须填写',
    'contact_message.min'       => '联系姓名长度不能少于2位',
    'contact_message.max'       => '联系姓名长度最多20位',
    'contact_email.require'     => '邮箱必须填写',
    'contact_email.email'       => '该邮箱为非法邮箱',
    'contact_title.require'     => '标题必须填写',
    'contact_title.min'         => '标题长度最多8位',
    'contact_message.require'   => '信息内容必须填写'
    ];
}
?>